#include "macros.h"

#if CV_VERSION_GREATER_EQUAL(3, 2, 0)

#include <opencv2/opencv_modules.hpp>

// we do not support DNN module for OpenCV 3.2 and lower
#if CV_VERSION_LOWER_THAN(3, 3, 0)
#undef HAVE_OPENCV_DNN
#endif

#else
// OpenCV < 3.2.0 does not contain opencv_modules.hpp,
// thus we include the modules based on which libraries
// are found in OPENCV_LIB_DIR
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_CALIB3D
#define HAVE_OPENCV_CALIB3D
#endif
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_FACE
#define HAVE_OPENCV_FACE
#endif
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_FEATURES2D
#define HAVE_OPENCV_FEATURES2D
#endif
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_IMGPROC
#define HAVE_OPENCV_IMGPROC
#endif
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_HIGHGUI
#define HAVE_OPENCV_HIGHGUI
#endif
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_IMGCODECS
#define HAVE_OPENCV_IMGCODECS
#endif
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_VIDEOIO
#define HAVE_OPENCV_VIDEOIO
#endif
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_ML
#define HAVE_OPENCV_ML
#endif
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_OBJDETECT
#define HAVE_OPENCV_OBJDETECT
#endif
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_PHOTO
#define HAVE_OPENCV_PHOTO
#endif
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_TEXT
#define HAVE_OPENCV_TEXT
#endif
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_TRACKING
#define HAVE_OPENCV_TRACKING
#endif
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_VIDEO
#define HAVE_OPENCV_VIDEO
#endif
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_XFEATURES2D
#define HAVE_OPENCV_XFEATURES2D
#endif
#ifdef OPENCV4NODEJS_FOUND_LIBRARY_XIMGPROC
#define HAVE_OPENCV_XIMGPROC
#endif

#endif

#ifdef HAVE_OPENCV_HIGHGUI
#ifdef HAVE_OPENCV_IMGCODECS
#ifdef HAVE_OPENCV_VIDEOIO
#define HAVE_IO
#endif
#endif
#endif